# --- SET UP ENVIRONMENT VARIABLES FOR MATLAB MCR ---
echo --- setting up environment variables ---
# presumed location of MATLAB Component Runtime (MCR) v8.3
# if the MCR is in a different location, edit the line below
mcr_root=${MUTSIG}/MATLAB_Compiler_Runtime/v81

cd ${MUTSIG}
## DISPLAY=172.16.124.163:0.0

## https://github.com/getzlab/MutSig2CV

export LD_LIBRARY_PATH=$mcr_root/runtime/glnxa64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$mcr_root/bin/glnxa64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$mcr_root/sys/os/glnxa64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$mcr_root/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$mcr_root/sys/java/jre/glnxa64/jre/lib/amd64/server:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$mcr_root/sys/java/jre/glnxa64/jre/lib/amd64:$LD_LIBRARY_PATH
export XAPPLRESDIR=$mcr_root/X11/app-defaults
export PATH=${PATH}:${MUTSIG}

class=GC
export MCR_CACHE_ROOT=${MutsigOut_path}/${class}/cache
mkdir -p ${MutsigOut_path}/${class}
mkdir -p ${MCR_CACHE_ROOT}

${MUTSIG}/MutSig2CV  \
${maf_public_path}/All_use.maf ${MutsigOut_path}/${class} \
2> ${log_path}/MutSig2CV.${class}.log


